function resetBehindSelect(id)
{
    id = $.trim(id);
    $('#'+id).nextAll('span').html('<select><option> - - 请选择 - - </option></select>');
}

function getCity(ProvinceId)
{
    ProvinceId = parseInt(ProvinceId);
    if(isNaN(ProvinceId) || ProvinceId<1){
        resetBehindSelect('province_select_ele');
        return ;
    }
    $.ajax({
        url:'/admin/zone/pass_ajax_get_city_select',
        data:{ "ProvinceId":ProvinceId },
        type:'get',
        success:function(msg){
            if(msg.st == 'y'){
                $('#city_select_ele').html(msg.htm);
                resetBehindSelect('city_select_ele');
            }else{
                alert(msg.note);
            }
        },
        error:function(){
            alert('网络繁忙，请稍候重试。');
        }
    });
}

function getDistrict(CityId)
{
    CityId = parseInt(CityId);
    if(isNaN(CityId) || CityId<1){
        resetBehindSelect('city_select_ele');
        return;
    }
    $.ajax({
        url:'/admin/zone/pass_ajax_get_district_select',
        data:{ "CityId":CityId },
        type:'get',
        success:function(msg){
            if(msg.st == 'y'){
                $('#district_select_ele').html(msg.htm);
                resetBehindSelect('district_select_ele');
            }else{
                alert(msg.note);
            }
        },
        error:function(){
            alert('网络繁忙，请稍候重试。');
        }
    });
}

function getTown(DistrictId)
{
    DistrictId = parseInt(DistrictId);
    if(isNaN(DistrictId) || DistrictId<1){
        resetBehindSelect('district_select_ele');
        return;
    }
    $.ajax({
        url:'/admin/zone/pass_ajax_get_town_select',
        data:{ "DistrictId":DistrictId },
        type:'get',
        success:function(msg){
            if(msg.st == 'y'){
                $('#town_select_ele').html(msg.htm);
            }else{
                alert(msg.note);
            }
        },
        error:function(){
            alert('网络繁忙，请稍候重试。');
        }
    });
}